home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- *
- * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/pathconf,v $
- * $Date: 1996/10/30 22:02:47 $
- * $Revision: 1.1 $
- * $State: Rel $
- * $Author: unixlib $
- *
- * $Log: pathconf,v $
- * Revision 1.1 1996/10/30 22:02:47 unixlib
- * Initial revision
- *
- ***************************************************************************/
-
- static const char rcs_id[] = "$Id: pathconf,v 1.1 1996/10/30 22:02:47 unixlib Rel $";
-
- /* unix.c.pathconf. Return filing system implementation details.
-
- Written by Nick Burrett, 13 October 1996. */
-
- #include <errno.h>
- #include <limits.h>
- #include <unistd.h>
- #include <stddef.h>
-
- /* These functions are stub varieties that need a proper
- implementation. */
-
- long int
- pathconf (const char *filename, int parameter)
- {
- filename = filename;
-
- switch (parameter)
- {
- default:
- errno = EINVAL;
- return -1;
-
- case _PC_LINK_MAX:
- #ifdef LINK_MAX
- return LINK_MAX;
- #else
- return -1;
- #endif
-
- case _PC_MAX_CANON:
- #ifdef MAX_CANON
- return MAX_CANON;
- #else
- return -1;
- #endif
-
- case _PC_MAX_INPUT:
- #ifdef MAX_INPUT
- return MAX_INPUT;
- #else
- return -1;
- #endif
-
- case _PC_NAME_MAX:
- #ifdef NAME_MAX
- return NAME_MAX;
- #else
- return -1;
- #endif
-
- case _PC_PATH_MAX:
- #ifdef PATH_MAX
- return PATH_MAX;
- #else
- return -1;
- #endif
-
- case _PC_PIPE_BUF:
- #ifdef PIPE_BUF
- return PIPE_BUF;
- #else
- return -1;
- #endif
-
- case _PC_CHOWN_RESTRICTED:
- #ifdef _POSIX_CHOWN_RESTRICTED
- return _POSIX_CHOWN_RESTRICTED;
- #else
- return -1;
- #endif
-
- case _PC_NO_TRUNC:
- #ifdef _POSIX_NO_TRUNC
- return _POSIX_NO_TRUNC;
- #else
- return -1;
- #endif
-
- case _PC_VDISABLE:
- #ifdef _POSIX_VDISABLE
- return _POSIX_VDISABLE;
- #else
- return -1;
- #endif
- }
- }
-
- long int
- fpathconf (int fd, int selection)
- {
- fd = fd;
-
- return pathconf (0, selection);
- }
-